package com.learning.platform.dto;

import com.learning.platform.enums.Difficulty;
import com.learning.platform.enums.QuestionType;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import jakarta.validation.constraints.DecimalMin;

import java.math.BigDecimal;

public class QuestionBankRequest {
    
    @NotNull(message = "课程ID不能为空")
    private Long courseId;
    
    @NotBlank(message = "题目标题不能为空")
    @Size(max = 200, message = "题目标题不能超过200字符")
    private String title;
    
    @NotBlank(message = "题目内容不能为空")
    private String content;
    
    @NotNull(message = "题目类型不能为空")
    private QuestionType questionType;
    
    private String options; // JSON格式的选项
    
    @NotBlank(message = "正确答案不能为空")
    private String correctAnswers; // JSON格式的正确答案
    
    private String explanation;
    
    private Difficulty difficulty = Difficulty.MEDIUM;
    
    @DecimalMin(value = "0.1", message = "题目分值必须大于0")
    private BigDecimal points = new BigDecimal("5.00");
    
    // Constructors
    public QuestionBankRequest() {}
    
    // Getters and Setters
    public Long getCourseId() {
        return courseId;
    }
    
    public void setCourseId(Long courseId) {
        this.courseId = courseId;
    }
    
    public String getTitle() {
        return title;
    }
    
    public void setTitle(String title) {
        this.title = title;
    }
    
    public String getContent() {
        return content;
    }
    
    public void setContent(String content) {
        this.content = content;
    }
    
    public QuestionType getQuestionType() {
        return questionType;
    }
    
    public void setQuestionType(QuestionType questionType) {
        this.questionType = questionType;
    }
    
    public String getOptions() {
        return options;
    }
    
    public void setOptions(String options) {
        this.options = options;
    }
    
    public String getCorrectAnswers() {
        return correctAnswers;
    }
    
    public void setCorrectAnswers(String correctAnswers) {
        this.correctAnswers = correctAnswers;
    }
    
    public String getExplanation() {
        return explanation;
    }
    
    public void setExplanation(String explanation) {
        this.explanation = explanation;
    }
    
    public Difficulty getDifficulty() {
        return difficulty;
    }
    
    public void setDifficulty(Difficulty difficulty) {
        this.difficulty = difficulty;
    }
    
    public BigDecimal getPoints() {
        return points;
    }
    
    public void setPoints(BigDecimal points) {
        this.points = points;
    }
}